<template>
	<view class="student-archives">
		<view class="title bold" v-if="num != ''">我的学员({{num}}人)</view>
		<view class="list-cell flex-align" v-for="(item1, index1) in itemArr" :key="index1">
			<u-avatar :src="item1.head_img" size="90rpx"></u-avatar>
			<view class="right flex-grow-1">
				<view class="name">{{ item1.name }}</view>
				<view class="phone">{{ item1.phone }}</view>
			</view>
			<view class="rightlist flex-grow-1">
				<image style="width: 30rpx; height: 30rpx;margin-left: 10%;" :src="shanchu" mode=""
					@click="del(item1)"></image>
			</view>
		</view>

		<view class="bottom-add-btn">
			<u-button text="添加学员" shape="circle" @click="add"
				color="linear-gradient(0deg, #0E9698 0%, #0E9698 100%)"></u-button>
		</view>
	</view>
</template>

<script>
	// const venues = require("@/api/venues/venues.js");
	export default {

		data() {
			return {
				itemArr: [
					{
						avatar:'',
						name:'哈哈哈',
						phone:'15615915915',
					},
					{
						avatar:'',
						name:'哈哈哈',
						phone:'15615915915',
					},
					{
						avatar:'',
						name:'哈哈哈',
						phone:'15615915915',
					}
				],
				num: '',
				bianji: this.$https.assetsPath + "bianji.png",
				shanchu: this.$https.assetsPath + "shanchu.png",
			}
		},
		onShow() {
			// this.selectStudent()
		},
		methods: {

			async selectStudent() {
				let params = {
					page: 1,
					pageSize: 10,
					openid: uni.getStorageSync('openid'),
					app_id: this.$https.weixinAppId,
					project_id: getApp().globalData.projectId,
				}
				let res = await index.selectStudent(params)
				if (res.code == 1) {
					
				}
			},
			del(item) {
				let that = this
				uni.showModal({
					title: '删除',
					content: '是否确定删除！',
					success: function(res) {
						if (res.confirm) {
							console.log('用户点击确定');
						} else if (res.cancel) {
							console.log('用户点击取消');
						}
					}
				});

			},
			add() {
				uni.navigateTo({
					url: '/pages_other/student/add/add'
				});
			}

		}
	}
</script>

<style lang="scss" scoped>
	.student-archives {
		padding: 0 34rpx;

		/deep/.u-index-list {
			scroll-view {
				height: calc(100vh - 220rpx - env(safe-area-inset-bottom));
				;
			}
		}

		.title {
			font-size: 32rpx;
			height: 100rpx;
			padding-top: 40rpx;

			&::before {
				content: '';
				display: inline-block;
				width: 6rpx;
				height: 28rpx;
				background-color: #0E9698 ;
				margin-top: 2rpx;
				margin-right: 22rpx;
			}
		}

		.list-cell {
			padding: 24rpx 0;
			position: relative;

			&::before {
				content: '';
				position: absolute;
				left: 110rpx;
				bottom: 0;
				right: 0;
				height: 1px;
				background-color: #f2f2f2;
			}

			.right {
				margin-left: 20rpx;
			}

			.rightlist {
				position: absolute;
				right: 40rpx;
				// margin-left: 40%;
			}

			.phone {
				font-size: 22rpx;
				font-weight: 400;
				margin-top: 10rpx;
				color: #BEBEBE;
			}
		}
	}
</style>
